package com.google.code.chaotic.dto;

import java.util.HashMap;

public enum UserType {

	COMMUTER("cm"), 
	ADMIN("ad");

	public final String id;
	private static HashMap<String, UserType> completeMap;

	UserType(String id) {
		this.id = id;
		UserType.getMap().put(id, this);
	}

	public static UserType getById(String id) {
		return UserType.completeMap.get(id);
	}
	
	private static synchronized HashMap<String, UserType> getMap() {
		if(completeMap == null)
			 completeMap =  new HashMap<String, UserType>( 3, 1.0f);
		return completeMap;
	}
}